using System;
using System.Collections.Generic;
using System.Text;

namespace Hoshimi
{
	public class Strategy_ManageState : State
	{
		#region Singleton

		// Fields
		protected static Strategy_ManageState instance;

		// Constructor
		protected Strategy_ManageState() : base() { }

		// Methods
		public static Strategy_ManageState Instance()
		{
			// Uses "Lazy initialization"
			if( instance == null ) 
				instance = new Strategy_ManageState();

			return instance;
		}

		#endregion

		public override bool Play( Unit unit )
		{
			StrategyManager manager = (StrategyManager) unit;

			manager.CheckIfUseBuildOrder();

			// try to predict if Pierre nanoAI is dead
			manager.TryPredictPierreNanoAIDeath();

			// Release a ressource if necessary
            manager.ReleaseUnitIfNecessary();

			return true;
		}
	}
}
